local sk__jiexi = fk.CreateSkill {

  name = "sk__jiexi",

  tags = {},

}



sk__jiexi:addEffect("active", {
  name = "sk__jiexi",
  anim_type = "control",
  card_num = 0,
  target_num = 1,
  prompt = "#sk__jiexi",
  can_use = function(self, player)
    return not player:isKongcheng()
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected == 0 and player:canPindian(to_select)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local pindian = player:pindian({ target }, sk__jiexi.name)
    if pindian.results[target].winner == player and not player.dead and not target.dead and not target:isAllNude() then
      room:useVirtualCard("dismantlement", nil, player, target, sk__jiexi.name)
    end
  end,
})

return sk__jiexi
